< previous page page_154 next page >

Page 154
properties for compatibility, but you should avoid them. If you have to set the font for two text boxes, for example, you can set one directly from the CommonDialog control's properties and the other one simply by assigning the first text box's Font property:
Set txtAddress.Font = txtName.Font
Figure 7.7 shows the Font dialog box that is presented to the user. This particular dialog box contains both screen and printer fonts.
0154-01.jpg
Figure 7.7
The Font dialog box can be programmed
to display screen fonts, printer fonts, or both.
Table 7.4 shows the control's properties and the font attributes that each manipulates.
Table 7.4 CommonDialog Control Properties That Store Font Attributes
PropertyAttribute
FontNameThe name of the base font
FontSizeThe height of the font in points
FontBoldWhether boldface is selected
FontItalicWhether italic is selected
FontUnderlineWhether the font is underlined
FontStrikethruWhether the font has a line through it

The font information can be used to set the font of any object in your program or even to set the font for the Printer object. Be sure to peruse the Help system for a complete list of Flags property constants.
The Color Dialog Box
The CommonDialog control's Color dialog box lets the user select colors that can be used for the foreground or background colors of your forms or controls (see Figure 7.8). The user has the option of choosing one of the standard colors, or creating and selecting a custom color.

 
< previous page page_154 next page >